//
//  HMSportCameraMaskView.m
//  XRSport
//
//  Created by acer on 16/10/29.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "HMSportCameraMaskView.h"
#import "HMAddtional.h"

@interface HMSportCameraMaskView()
@property (nonatomic, weak) IBOutlet UIImageView *cameraImageV;
@end
@implementation HMSportCameraMaskView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    
    UIBezierPath *path = [UIBezierPath bezierPathWithRect:rect];
    [[UIColor hm_colorWithHex:0x24282e alpha:1] setFill];
    [path fill];
    
    UIBezierPath *path1 = [UIBezierPath bezierPath];
    if (_cameraImageV.frame.origin.x > 0) {
        
        [path1 moveToPoint:CGPointMake(rect.size.width, 0)];
        [path1 addLineToPoint:CGPointMake(rect.size.width, rect.size.height)];
    } else {
        [path1 moveToPoint:CGPointMake(0, 0)];
        [path1 addLineToPoint:CGPointMake(0, rect.size.height)];
    }
    [[UIColor hm_colorWithHex:0x1a1a1a alpha:1] setStroke];
    [path1 stroke];
    
    CGContextClearRect(UIGraphicsGetCurrentContext(), CGRectInset(_cameraImageV.frame, 1, 1));
}


@end
